import React from 'react'
import { View, Button, Text, Caption } from '@shoutem/ui'

const FavoriteDetail = ({level, onFavoritePress, onLikePress, post, time}) => {
  const label = level === 'favorite' ? '取消收藏' : '取消点赞'
  const onPress = level === 'favorite' ? onFavoritePress : onLikePress

  return (
    <View styleName="horizontal">
      <Button
        styleName="full-width"
        onPress={() => {
          onPress(post, true)
        }
      }
      >
        <Text>{label}</Text>
      </Button>
      <View styleName="content">
        <Caption>收藏时间</Caption>
        <Caption>{time}</Caption>
      </View>
    </View>
  )
}

export default FavoriteDetail
